//Mapper和数据库进行交互的
package com.example.demo.mapper;

import com.example.demo.pojo.User;
import org.apache.ibatis.annotations.*;

import java.time.LocalDateTime;
import java.util.List;

@Mapper
public interface UserMapper {
    /**
     * 根据用户名查询用户
     * @param username
     * @return
     */
    @Mapper
    @Select("select *from users where username=#{username}")
    User selectByUsername(String username);

    @Mapper
    @Insert("insert into users(username,password) values(#{username},#{password})")
    void insertUser(User newUser);
}